/*==========================================================================

	DWMAPI - Hand Held Products Dolphin Wireless Manager API

	
	UNLESS OTHER WISE AGREED TO BY HAND HELD PRODUCTS AND THE USER OF THIS CODE,
	THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
	ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
	THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
	PARTICULAR PURPOSE.

	COPYRIGHT (C) 2007 HAND HELD PRODUCTS, Inc.

	THIS SOFTWARE IS PROTECTED BY COPYRIGHT LAWS OF THE UNITED STATES OF 
	AMERICA AND OF FOREIGN COUNTRIES. THIS SOFTWARE IS FURNISHED UNDER A 
	LICENSE AND/OR A NONDISCLOSURE AGREEMENT AND MAY BE USED IN ACCORDANCE 
	WITH THE TERMS OF THOSE	AGREEMENTS. UNAUTHORIZED REPRODUCTION, 
	DUPLICATION OR DISTRIBUTION OF THIS SOFTWARE, OR ANY PORTION OF IT 
	WILL BE PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER THE LAW.

	Description: 
	
	The DWMAPI manages wireless radio power states
				
==========================================================================*/

#ifndef DWMAPI
#define DWMAPI

#include <windows.h>
#include <tapi.h>

#define MAX_SWC_STATUS_LINES	64
#define MAX_SWC_RESPONSE		2048
#define SWC_PREFIX				"DSFLTR_"

#define DWM_RADIO_NOT_PRESENT				((DWORD) -1)

#define DWM_WLAN_POWER_OFF					0
#define DWM_WLAN_POWER_ON					1
//Mobile Device Manager Disabled
#define DWM_WLAN_MDM_DISABLED				DWM_RADIO_NOT_PRESENT

#define DWM_BTH_POWER_OFF					0
#define DWM_BTH_POWER_ON_CONNECTABLE		1
#define DWM_BTH_POWER_ON_DISCOVERABLE		2
#define DWM_BTH_POWER_ON_AUTOMATIC			3
//Mobile Device Manager Disabled
#define DWM_BTH_MDM_DISABLED				DWM_RADIO_NOT_PRESENT

#define DWM_PHONE_POWER_OFF					0
#define DWM_PHONE_POWER_ON					1

#define DWM_GOBI_POWER_OFF					0
#define DWM_GOBI_POWER_ON					1

//Mobile Device Manager Disabled
#define DWM_PHONE_MDM_DISABLED				DWM_RADIO_NOT_PRESENT
#define DWM_DISABLE_WAIT_CURSOR             (1 << 30)

// Types of radio device
typedef enum _DWM_RADIOTYPE
{
    DWM_RADIOTYPE_WLAN = 1,
    DWM_RADIOTYPE_PHONE = 2,
    DWM_RADIOTYPE_BLUETOOTH = 3,
    DWM_RADIOTYPE_GPS = 4,
    DWM_RADIOTYPE_GOBI = 5,
} DWM_RADIOTYPE;

//MDM KEYS
#define BT_MDM_STATE_PATH    TEXT("Comm\\NetworkPolicy\\Bluetooth")
#define BT_MDM_STATE_VALUE   TEXT("Disabled")
#define BT_MDM_DISABLED_REG_VALUE 1


#define WLAN_MDM_STATE_PATH    TEXT("Comm\\NetworkPolicy\\Wifi")
#define WLAN_MDM_STATE_VALUE   TEXT("Disabled")
#define WLAN_MDM_DISABLED_REG_VALUE 1

// GOBI SIM SELECT
#define GOBI_SIM_SELECT_PATH    TEXT("Comm\\SWGobiUSBNDIS1\\Parms")
#define GOBI_SIM_SELECT_VALUE	TEXT("SIMSelect")

// GOBI DRIVER
#define GOBI_DRIVER_PATH    	TEXT("Comm\\SWGobiUSBNDIS1\\Parms")
#define REG_KEY_GRC1			TEXT("Drivers\\BuiltIn\\GRC1")
#define REG_VAL_ACTIVE_SIM		TEXT("ActiveSIM")


#ifdef __cplusplus
extern "C" {
#endif

// public functions

BOOL		DWM_Init();
BOOL		DWM_Deinit();
BOOL		DWM_IsRadioPresent(DWM_RADIOTYPE RadioType);
BOOL		DWM_GetRadioName(DWM_RADIOTYPE RadioType, WCHAR *pszName, DWORD dwMaxChars);
BOOL		DWM_GetRadioState(DWM_RADIOTYPE RadioType, DWORD *pdwState);
BOOL		DWM_SetRadioState(DWM_RADIOTYPE RadioType, DWORD dwState, BOOL bBlock, BOOL bReg);
BOOL		DWM_SetActiveSIM(DWORD ActiveSIM);
BOOL		DWM_GetActiveSIM(DWORD *ActiveSIM);


// private functions

HANDLE		DWM_GetSWCHandle();
HLINEAPP	DWM_GetTAPIUsageHandle();
HLINE		DWM_GetTAPILineDeviceHandle();



#ifdef __cplusplus
}
#endif

#endif DWMAPI



